#include <stdio.h>
struct person{
    char name[20];
    int age;
} man[3];
int main(){
    int i,key = 0;
    struct person *p, *q;
    for(i=0;i<3;i++){
        scanf("%s %d",man[i].name,&man[i].age);
    }
    for(p=man;p<man+3;p++){
        if(p->age>key){
            q = p;
            key = p->age;
        }
    }
    printf("%s,%d",q->name,q->age);
    return 0;
}